#ifndef __H264_SLICE_HEADER_HPP__
#define __H264_SLICE_HEADER_HPP__

#include<stdint.h>
#include "FileReader.hpp"
#include "Bistream.hpp"
#include "H264SPS.hpp"
#include "H264PPS.hpp"

class SliceHeader : public Nalu{ 
public:
    int Parse(NaluSPS (&msps)[H264_MAX_SPS_COUNT, NaluPPS (&mpps)[H264_MAX_PPS_COUNT]) override;
    void ref_pic_list_mvc_modification();
    void ref_pic_list_modification(BitStream& bitstream);
    void def_ref_pic_marking(BitStream& bitstream);
    void pred_weight_table(BitStream& bitstream);

public:
    uint32_t    first_mb_in_slice;  //ue
    uint32_t    slice_type;         //ue
    uint32_t    pic_parameter_id;   //ue
    int16_t     colour_plane_id;    //u(2)
    uint32_t    frame_num;         //u(v)
    uint8_t     field_pic_flag;     //u1
    uint8_t     bottom_field_flag;  //u1
    uint32_t    idr_pic_id;         //ue
    uint32_t    pic_order_cnt_lsb;  //u(v)
    int32_t     delta_pic_order_cnt_bottom; //se
    int32_t     delta_pic_order_cnt[2]; //se
    uint32_t    redundant_pic_cnt;   //ue
    uint8_t     direct_spatial_mv_pred_flag;  //u1
    uint8_t     num_ref_idx_active_override_flag; //u1
    uint32_t    num_ref_idx_l0_active_minus1; //ue
    uint32_t    num_ref_idx_l1_active_minus1; //ue

    uint8_t     ref_pic_list_modification_flag_l0;//u1
    uint8_t     ref_pic_list_modification_flag_l1;//u1
    uint32_t    modification_of_pic_nums_idc;     //ue
    uint32_t    abs_diff_pic_num_minus1;          //ue
    uint32_t    long_term_pic_num;                //ue

    uint32_t    luma_log2_weight_denom;  //ue
    uint32_t    chroma_log2_weight_denom; //ue
    uint8_t     luma_weight_l0_flag;     //u1
    int32_t     luma_weight_l0[10];  //se
    int32_t     luma_offset_l0[10];
    uint8_t     chroma_weight_l0_flag; //u1
    int32_t     chroma_weight_l0[10][10];  //se
    int32_t     chroma_offset_l0[10][10];  //se
    uint8_t     luma_weight_l1_flag;
    int32_t     luma_weight_l1[10];
    int32_t     luma_offset_l1[10];
    uint8_t     chroma_weight_l1_flag;
    int32_t     chroma_weight_l1[10];
    int32_t     chroma_offset_l1[10];

    uint8_t     no_output_of_prior_pics_flag;  //u1
    uint8_t     long_term_reference_flag;   //u1
    uint8_t     adaptive_ref_pic_marking_mode_flag;  //u1
    uint32_t    memory_management_control_operation; //ue
    uint32_t    difference_of_pic_nums_minus1;   //ue
    //uint32_t    long_term_pic_num;
    uint32_t    long_term_frame_idx;  //u3
    uint32_t    max_long_term_frame_idx_plus1;  //ue

    uint32_t    cabac_init_idc;             //ue
    int32_t     slice_qp_delta;             //se
    uint8_t     sp_for_switch_flag;         //u1
    int32_t     slice_qs_delata;            //se
    uint32_t    disable_deblocking_filter_idc; //ue
    int32_t     slice_alpha_c0_offset_div2;    //se
    int32_t     slice_beta_offset_div2;        //se
    int32_t     slice_group_change_cycle;      //u(v)


};









#endif